// #[warn(unused_variables)]
// #[warn(unused_assignments)]

fn main() {
    println!("before app_handler");
    app_handler();
    println!("after app_handler");
}

#[allow(unused_variables)]
#[allow(unused_assignments)]
fn app_handler(){
    let mut a = Application {
        name: "MyApp1".to_string(),
        nicknames: vec!["MyApp1-name1".to_string(), "MyApp1-name2".to_string()],
    };
    println!("before assignment.");

    a = Application {
        name: "MyApp2".to_string(),
        nicknames: vec!["MyApp2-name1".to_string(), "MyApp2+name2".to_string()],
    };
    println!("at end of block.")
}

struct Application {
    pub name : String,
    pub nicknames: Vec<String>,
}

impl Drop for Application {
    fn drop(&mut self) {
        println!("Dropping {}", self.name);
        if !self.nicknames.is_empty() {
            println!("Nicknames: {:?}", self.nicknames.join(","));
        }
    }
}
